﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using NewDDSys.Entity;
using NewDDSys.IBLL;
using NewDDSys.IDAL;
using NewDDSys.Factory;
using NewDDSys.Utility;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class Web_FC : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        btnOK.Attributes.Add("onclick", "javascript:if(confirm('" + "确认无误，并提交么？" + "')== false) return false;");
    }
    protected void btnOK_Click(object sender, EventArgs e)
    {
        int checkValue = 0;
        FcInfo fc = new FcInfo();
        fc.Fday = DateTime.Now.ToString();
        fc.Cxh = txtCxh.Text.ToString();
        fc.Dun = Convert.ToDecimal(txtDun.Text.ToString());
        fc.Fcy = ddlFcy.SelectedValue.ToString();
        fc.Jt = txtJt.Text.ToString();
        fc.Ku = Session["用户信息.部门"].ToString();
        fc.Cf = Convert.ToDecimal(txtCf.Text.ToString());
        fc.Js = Convert.ToDecimal(txtJs.Text.ToString());
        fc.Num = BLLFactory.CreateFcBLL().AUTOID();
        checkValue = BLLFactory.CreateFcBLL().AddFc(fc);
        if (checkValue >= 1)
        {
            Response.Write(" <script   language=javascript> window.alert( ' 提交成功！ ');</script> ");
        }
        if (txtBeizhu.Text.ToString() != "")
            BLLFactory.CreateFcBLL().UpdateFcBZ(fc.Num, txtBeizhu.Text.ToString());
        Response.Redirect("FCJL.aspx");
    }
    protected void btnRepeat_Click(object sender, EventArgs e)
    {
        txtCxh.Text = "";
        txtDun.Text = "";
        ddlFcy.SelectedIndex = 0;
        txtJt.Text = "";
        txtCf.Text = "";
        txtJs.Text = "";
        txtBeizhu.Text = "";
    }
}
